<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>

        .box{
           width: 940px; 
           background: rebeccapurple;
           height: 200px;
        }

       .box div{
            width: 300px;
            height: 200px;
            background: red;
            margin-right: 20px;
            float: left;
        }
        /* 第一种方式 */
        /* .box .last{
            margin-right: 0;
        } */
        /* 第二种方式 最后一个div */
        .box div:last-child{
            margin-right: 0;
        }

    </style>

</head>
<body>
    <div class="box">

        <div></div>
        <div></div>
        <div></div>
        
    </div>
    
    
</body>
</html>